<template>
  <div class="app-container">
    <!-- 查询模块 -->
    <div class="formDiv">
      <el-form ref="form" :inline="true" label-width="130px">
        <el-row>
          <el-col :span="6">
            <el-form-item label="姓名">
              <el-input v-model="params.realname" placeholder="请输入姓名" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="手机号">
              <el-input v-model="params.username" placeholder="请输入手机号" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="提现时间">
              <el-date-picker
                v-model="time"
                type="daterange"
                value-format="yyyy-MM-dd HH:mm:ss"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :default-time="['00:00:00', '23:59:59']"
              />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="审核状态">
              <el-select v-model="params.transStatus">
                <el-option
                  v-for="item in StatusOption"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24" />
          <el-col :span="6">
            <el-form-item label="批次号">
              <el-input v-model="params.xbBatchNo"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="发放状态">
              <el-select v-model="params.xbStatus">
                <el-option
                  v-for="item in grantOption"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="转出银行">
              <!--  v-model="params.bankCard"  -->
              <el-select v-model="params.bankCard">
                <el-option
                  v-for="item in bankOption"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="提现金额">
              <div style="display: flex;">
                <el-input
                  v-model="params.minAmount"
                  style="width: 106px;"
                  placeholder="最低金额"
                  type="number"
                  min="1"
                  @keyup.native="proving($event)"
                />
                <span style="padding:0 5px;">—</span>
                <el-input
                  v-model="params.maxAmount"
                  style="width: 106px;"
                  placeholder="最高金额"
                  type="number"
                  @keyup.native="proving($event)"
                />
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="审核时间">
              <el-date-picker
                v-model="time1"
                type="daterange"
                value-format="yyyy-MM-dd HH:mm:ss"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :default-time="['00:00:00', '23:59:59']"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-button type="primary" @click="Examination('',0)">审核</el-button>
            <!-- <el-button type="primary" @click="changeBrank">修改银行卡</el-button> -->
          </el-col>
          <el-col :span="12" style="text-align: right;">
            <el-button type="primary" @click="searchFn">查询</el-button>
            <el-button
              type="primary"
              @click="excelEvent"
              v-if="$store.state.user.permissionJson.indexOf('AdminUsersAmountTransProvider.balanceScheduleListExport') !=-1"
            >导出</el-button>
            <el-button type="primary" @click="payCode">支付验证</el-button>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- table -->
    <div v-loading="tableLoading" class="table">
      <h4>总计提现{{ multipleSelection.length }}笔，提现金额{{ withdrawalAmount }}元，薪税宝账户余额{{ accountBalance }}元，工猫账户余额{{gongmallnum||0}}元</h4>
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <!-- <el-table-column type="selection" width="55" v-if="flag" :selectable="selectable"></el-table-column> -->
        <el-table-column type="selection" width="55" :selectable="selectable"></el-table-column>
        <el-table-column type="index" align="center" label="序号"></el-table-column>
        <el-table-column prop="realname" align="center" label="姓名"></el-table-column>
        <el-table-column prop="username" align="center" label="手机号">
          <template slot-scope="scope">
            <div>{{scope.row.username | phonereg }}</div>
          </template>
        </el-table-column>
        <el-table-column prop="accountType" align="center" label="用户类型"></el-table-column>
        <el-table-column prop="bankCard" align="center" label="转出银行卡"></el-table-column>
        <el-table-column prop="amount" align="center" label="提现金额"></el-table-column>
        <el-table-column prop="feeAmt" align="center" label="税款"></el-table-column>
        <el-table-column prop="expspayAmt" align="center" label="实到金额"></el-table-column>
        <el-table-column prop="cbinBank" align="center" label="提现银行"></el-table-column>
        <el-table-column prop="cardRealname" align="center" label="持卡人"></el-table-column>
        <el-table-column prop="cardNum" align="center" label="银行卡号"></el-table-column>
        <el-table-column prop="xbBatchNo" align="center" label="批次号"></el-table-column>
        <!-- <el-table-column
          prop="bankCard"
          align="center"
          label="转出银行卡"
          :show-overflow-tooltip="false"
        >
          <template slot-scope="scope">
            <span>{{ scope.row.bankCard}}</span>
          </template>
        </el-table-column>-->

        <el-table-column prop="time" align="center" label="提现时间" />
        <el-table-column prop="transStatusInt" align="center" label="审核状态">
          <template slot-scope="scope">
            <!-- <span>{{scope.row.transStatusInt}}</span> -->
            <span>{{scope.row.transStatusInt|withdrawStatusFilter}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="xbStatusInt" align="center" label="发放状态">
          <template slot-scope="scope">
            <!-- {{scope.row.bankCard}} -->
            <!-- <p v-if="scope.row.transStatusInt==0|scope.row.bankCard!='薪税宝' | scope.row.bankCard!='薪税宝'">无</p> -->
            <p>{{scope.row.xbStatus}}</p>
            <!-- 审核驳回时显示 -->
            <p
              v-if="scope.row.xbStatusInt==2 && scope.row.xbFailReason"
            >失败原因:{{scope.row.xbFailReason}}</p>
          </template>
        </el-table-column>
        <el-table-column prop="transTime" align="center" label="提现审核时间"></el-table-column>
        <el-table-column prop="adminRemark" align="center" label="驳回原因"></el-table-column>
        <el-table-column prop="adminUserId" align="center" label="操作人">
          <template slot-scope="scope">
            <span v-if="scope.row.transStatusInt!=0">{{ scope.row.adminUserId }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="xbOrderNo" align="center" label="业务单号"></el-table-column>
        <el-table-column fixed="right" width="100" label="操作" align="center">
          <template slot-scope="scope">
            <!-- <div> -->
            <el-button
              v-if="scope.row.transStatusInt==1&scope.row.xbStatusInt==2|(scope.row.transStatusInt==1&scope.row.bankCard!='薪税宝'&scope.row.bankCard!='工猫')"
              type="text"
              @click="Examination(scope.row,1,scope.row.id)"
            >修改状态</el-button>
            <el-button
              v-if="scope.row.transStatusInt==0"
              type="text"
              @click="Examination(scope.row,0,scope.row.id)"
            >审核</el-button>
            <el-button
              type="text"
              v-if="scope.row.transStatusInt==1&scope.row.bankCard!='薪税宝'&&scope.row.bankCard!='工猫'"
              @click="changeBrank(scope.row,scope.row.id)"
            >修改银行卡</el-button>
            <!-- </div> -->
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="pagesCon">
      <div>
        <el-pagination
          :current-page="params.pageNum"
          :page-sizes="[10, 20, 50, 100,200]"
          :page-size="params.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </div>
    </div>
    <!-- 审核 -->
    <el-dialog title="审核" :visible.sync="dialogVisible" width="468px">
      <el-form
        ref="ruleForm"
        :rules="ruleForm"
        :inline="true"
        label-width="80px"
        label-position="right"
        :model="datas"
      >
        <el-form-item label="审核意见" prop="radio">
          <el-radio-group v-model="datas.radio" @change="opinionChange">
            <p style="display: flex;">
              <el-radio v-if="istabledata" label="0">待审核</el-radio>
              <el-radio v-if="!istabledata" label="1">审核通过</el-radio>
              <el-radio label="2">审核驳回</el-radio>
              <!-- <el-radio v-if="!istabledata" label="2">审核驳回</el-radio> -->
            </p>
          </el-radio-group>
        </el-form-item>
        <el-form-item v-if="datas.radio==2" label="驳回原因" prop="remark">
          <el-input v-model="datas.remark" />
        </el-form-item>
        <el-form-item v-if="datas.radio==1" label="转出银行" prop="region">
          <!-- <branklist @brankfun="brankfun"></branklist> -->
          <el-select v-model="datas.region">
            <el-option
              v-for="item in bankOption"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="rewardSure('ruleForm')" :disabled="isDisable">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 银行卡修改弹窗 -->
    <el-dialog :title="bankdata.title" :visible.sync="dialogbrank" width="468px" @close="closeBank">
      <el-form
        ref="bankForm"
        :model="bankdata"
        :rules="bankRules"
        :inline="true"
        label-width="120px"
        label-position="right"
      >
        <el-form-item label="更换银行卡为" prop="bankRegion" v-if="bankdata.title=='银行卡修改'">
          <!-- <branklist @brankfun="brankfun" ref="branklist"></branklist> -->
          <el-select v-model="bankdata.bankRegion">
            <el-option
              v-for="item in bankChangeOption"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label v-if="bankdata.title!='银行卡修改'">
          批次：{{payroll.batchNum}}
          <br />
          当前进行中的支付共{{payroll.num}}笔
        </el-form-item>
        <el-form-item label="验证码" prop="captcha" v-if="bankdata.title!='银行卡修改'">
          <el-input
            placeholder="请输入验证码"
            size="mini"
            v-model="bankdata.captcha"
            class="input-with-select"
          >
            <el-button
              slot="append"
              size="mini"
              :disabled="isDisabled"
              @click="sendcode"
            >{{buttonName}}</el-button>
          </el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogbrank = false">取 消</el-button>
        <el-button type="primary" @click="brankSure">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import branklist from "@/components/branklist";
import {
  getList,
  accountsBalance,
  excelExport,
  bankChange,
  Reject,
  AuditPass,
  getBalanceByGongmall,
  getUploadPayroll,
  payPayrollByGongmall,
  getPaySmsByGongmall
} from "@/api/verification";
import { exportfile } from "@/api/exporfile";

export default {
  name: "Verification",
  components: {
    branklist
  },
  // 过滤
  filters: {
    // 审核状态过滤 0为待审核 1为审核通过 2为审核驳回
    withdrawStatusFilter(e) {
      switch (e) {
        case 0:
          return "未审核";
          break;
        case 1:
          return "审核通过";
          break;
        case 2:
          return "审核驳回";
          break;
        default:
          return "暂无";
          break;
      }
    },
    // 发放状态过滤 0：待发放 1：成功 2：失败
    xbStatusFilter(e) {
      switch (e) {
        case 0:
          return "待发放";
          break;
        case 1:
          return "发放成功";
          break;
        case 2:
          return "发放失败";
          break;
        default:
          return "暂无";
          break;
      }
    }
  },
  data() {
    return {
      buttonName: "发送短信",
      isDisabled: false,
      timeval: 60,
      gongmallnum: 0,
      payroll: {},
      permissionJson: JSON.parse(localStorage.getItem("permissionJson")),
      ValuableFlaf: false,
      // loading层
      tableLoading: false,
      // 提交查询数据
      params: {
        pageNum: 1,
        pageSize: 10,
        username: "",
        realname: "",
        transStatus: null,
        xbStatus: null,
        timeStart: "",
        timeEnd: "",
        bankCard: "",
        minAmount: "",
        maxAmount: ""
      },
      // 修改按钮的当前行id
      ids: "",
      datas: { radio: "1", remark: null, region: "" },
      bankdata: { bankRegion: "" },
      tableData: [],
      total: 0,
      time: [],
      time1: [],
      // 勾选的当前行数据
      rowInfo: null,
      // 勾选数据
      multipleSelection: [],
      // 修改银行卡id
      bankId: "",
      // 提现金额合计
      withdrawalAmount: 0,
      // 薪税宝账户余额
      accountBalance: "",
      dialogVisible: false,
      istabledata: true,
      dialogbrank: false,
      // 审核状态下拉框 0为待审核 1为审核成功 2为审核失败
      StatusOption: [
        { id: null, name: "全部" },
        { id: 0, name: "未审核" },
        { id: 1, name: "审核通过" },
        { id: 2, name: "审核驳回" }
      ],
      // 发放状态 0：待处理 1：成功 2：失败
      grantOption: [
        { id: null, name: "全部" },
        { id: 0, name: "待发放" },
        { id: 1, name: "发放成功" },
        { id: 2, name: "发放失败" }
      ],
      bankOption: [
        { id: "", name: "全部" },
        { id: "6226661401701333", name: "6226661401701333" },
        { id: "6226621407581295", name: "6226621407581295" },
        { id: "127912425910301", name: "127912425910301" },
        { id: "xb", name: "薪税宝" },
        { id: "gongmall", name: "工猫" }
      ],
      bankChangeOption: [
        { id: "", name: "全部" },
        { id: "6226661401701333", name: "6226661401701333" },
        { id: "6226621407581295", name: "6226621407581295" },
        { id: "127912425910301", name: "127912425910301" }
      ],
      // 校验规则captcha
      ruleForm: {
        radio: [
          { required: true, message: "请选择审核意见", trigger: "change" }
        ],
        remark: [
          { required: true, message: "驳回原因为必填项", trigger: "blur" }
        ],
        captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }],
        region: [{ required: true, message: "请选择银行卡", trigger: "change" }]
      },
      bankRules: {
        bankRegion: [
          { required: true, message: "请选择转出银行卡", trigger: "change" }
        ]
      },
      //选择的银行卡号
      banckNumber: "",
      //区分审核、修改弹窗的开关
      typeFlag: "",
      isDisable: false //表单重复提交
    };
  },
  inject: ["reload"],
  //过滤
  filters: {
    //审核状态过滤 0为待审核 1为审核通过 2为审核驳回
    withdrawStatusFilter(e) {
      switch (e) {
        case 0:
          return "未审核";
          break;
        case 1:
          return "审核通过";
          break;
        case 2:
          return "审核驳回";
          break;
        default:
          return "暂无";
          break;
      }
    },
    //发放状态过滤 0：待发放 1：成功 2：失败
    xbStatusFilter(e) {
      switch (e) {
        case 0:
          return "待发放";
          break;
        case 1:
          return "发放成功";
          break;
        case 2:
          return "发放失败";
          break;
        default:
          return "暂无";
          break;
      }
    }
  },
  inject: ["reload"],
  mounted() {
    this.getList(this.params);
    this.accountsBalance();
    this.getBalanceByGongmall();
  },
  methods: {
    //发送验证
    async sendcode() {
      let res = await getPaySmsByGongmall();

      this.$message.warning(res.data.msg);
      let me = this;
      me.isDisabled = true;
      let interval = setInterval(function() {
        me.buttonName = "（" + me.timeval + "秒）";
        --me.timeval;
        if (me.timeval < 0) {
          me.buttonName = "重新发送";
          me.timeval = 60;
          me.isDisabled = false;
          clearInterval(interval);
        }
      }, 1000);
    },
    async getBalanceByGongmall() {
      let res = await getBalanceByGongmall();
      console.log(res);
      if (res.data.code == 0) {
        this.gongmallnum = res.data.data;
      }
    },
    //支付验证
    async payCode() {
      let res = await getUploadPayroll();
      if (res.data.code == 0) {
        this.payroll = res.data.data;
        this.dialogbrank = true;
        this.bankdata.title = "验证码";
      } else {
        this.$message.warning(res.data.msg);
      }
    },
    // 按钮权限
    hasPermission(e) {
      return window.helper.hasPermission(e);
    },
    // 最小金额输入限制
    proving(e) {
      var keynum = window.event ? e.keyCode : e.which; // 获取键盘码
      var keychar = String.fromCharCode(keynum); // 获取键盘码对应的字符
      if (keynum == 189 || keynum == 190 || keynum == 109) {
        this.$message.warning("禁止输入小数以及负数");
        e.target.value = " ";
      }
    },
    // 复选框禁用控制
    selectable(row, index) {
      if (row.transStatusInt == 0) {
        return true;
      } else {
        return false;
      }
    },
    // checkbox(row){
    //   console.log(row.row.transStatus)
    //   if(row.row.transStatus.indexOf("成") == -1){
    //     return "mycell"
    //   }
    // },
    // 服务商账户管理列表
    getList(e) {
      this.tableLoading = true;
      const datas = e;
      getList(datas)
        .then(res => {
          console.log(res);
          if (!res.data.code) {
            this.tableData = res.data.data.list;
            this.total = res.data.data.count;
          } else {
            this.$message.error(res.data.msg);
          }
          this.tableLoading = false;
        })
        .catch(error => {
          this.$message.error(error);
          this.tableLoading = false;
        });
    },
    // 薪宝账户余额查询
    accountsBalance() {
      accountsBalance().then(res => {
        // console.log(res);
        this.accountBalance = res.data.data;
      });
    },

    // 查询
    searchFn() {
      this.params.pageNum = 1;
      // console.log(this.params)
      if (this.time != null) {
        if (this.time.length) {
          this.params.timeStart = this.time[0];
          this.params.timeEnd = this.time[1];
        }
      } else {
        this.params.timeStart = null;
        this.params.timeEnd = "";
      }
      if (this.time1 != null) {
        if (this.time1.length) {
          this.params.transTimeStart = this.time1[0];
          this.params.transTimeEnd = this.time1[1];
        }
      } else {
        this.params.transTimeStart = null;
        this.params.transTimeEnd = "";
      }
      this.getList(this.params);
    },
    // 导出
    excelEvent() {
      let datas = { ...this.params };
      delete datas.pageNum;
      delete datas.pageSize;
      excelExport(this.params).then(res => {
        exportfile(res);
      });
    },
    // 转出银行
    brankfun(datas) {
      // console.log(datas + "-----银行列表");
      this.banckNumber = datas;
      this.params.bankCard = datas;
    },
    // 单选框勾选
    handleSelectionChange(val) {
      this.multipleSelection = val;
      // console.log(val);
      if (val.length >= 1) {
        const arr1 = [];
        this.multipleSelection.forEach(item => {
          arr1.push(item.amount);
        });
        this.withdrawalAmount = arr1.reduce((a, b) => {
          return a + b;
        });
      } else {
        this.withdrawalAmount = 0;
      }

      // console.log(this.result)
      // this.withdrawalAmount = result;
    },

    // 审核弹窗监听radio切换
    opinionChange(val) {
      this.datas.radio = val;
      this.$refs.ruleForm.clearValidate();
    },
    // 修改银行卡弹框
    changeBrank(data, id) {
      // if (this.multipleSelection.length >= 1) {
      this.dialogbrank = true;
      this.bankdata.title = "银行卡修改";
      // this.$refs.branklist.value = "";
      // } else {
      //   this.$message({
      //     message: "请先勾选需要修改银行卡的数据",
      //     type: "warning"
      //   });
      // }
      this.bankId = id;
    },
    // 银行卡修改确定
    async brankSure() {
      this.dialogbrank = false;
      //   console.log("银行卡修改");
      if (this.bankdata.title == "银行卡修改") {
        const bankCard = { ...this.bankdata.bankRegion };
        // console.log(bankCard);
        const data = {
          bankCard: this.bankdata.bankRegion,
          ids: []
        };
        // this.multipleSelection.forEach(datas => {
        data.ids.push(this.bankId);
        // });
        bankChange(data)
          .then(res => {
            // console.log(res);
            if (!res.data.code) {
              this.$message.warning(res.data.msg);
              this.getList(this.params);
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(error => {
            this.$message.error(error);
            this.tableLoading = false;
          });
      } else {
        this.bankdata.batchNum = this.payroll.batchNum;
        let res = await payPayrollByGongmall(this.bankdata);
        if (res.data.code == 0) {
          this.$message.warning(res.data.msg);
          this.getList(this.params);
        } else {
          this.$message.error(res.data.msg);
        }
      }
    },
    // 修改银行卡弹框关闭
    closeBank() {
      this.$refs.bankForm.clearValidate();
      // this.bankdata.bankRegion = "";
      // this.$refs.branklist.value = "";
    },
    // 审核、修改弹框
    Examination(datas, type, id) {
      // type:0  审核
      // type:0 datas有值 待审核
      // type:1  修改银行卡
      this.datas.radio = "";
      this.datas.remark = "";
      this.datas.region = "";
      this.ids = id;
      // console.log(this.ids);
      // 审核
      if (type == 0) {
        this.rowInfo = datas;
        this.ValuableFlaf = true;
      }

      if (datas) {
        // 有值table 页面
        this.dialogVisible = true;
        this.ValuableFlaf = true;
      } else {
        // 列表页的群体操作
        if (this.multipleSelection.length >= 1) {
          this.dialogVisible = true;
        } else {
          this.$message({
            message: "请先勾选需要审核的数据",
            type: "warning"
          });
        }
      }
      this.istabledata = type;

      this.typeFlag = type;
      // console.log(this.typeFlag);
    },
    // 审核通过、审核驳回、待审核传参
    change(status, flag) {
      const data = {
        transStatus: status,
        bankCard: this.datas.region,
        adminRemark: this.datas.remark,
        ids: []
      };
      if (flag) {
        // 当flag为真时，修改的id参数
        data.ids.push(this.ids);
      } else {
        if (this.multipleSelection.length >= 1) {
          // 批量审核
          this.multipleSelection.forEach(datas => {
            data.ids.push(datas.id);
          });
        } else {
          // 选择每一行的审核
          data.ids.push(this.rowInfo.id);
        }
      }
      // 审核通过时调用
      // console.log(this.datas.radio);
      if (this.datas.radio == 1) {
        this.AuditPass(data);
        // 审核驳回及待审核
      } else if (this.datas.radio == 2) {
        data.transStatus = 2;
        this.Reject(data);
      } else {
        data.transStatus = 0;
        this.Reject(data);
      }
      // console.log(this.datas.radio);
    },

    // 审核确定
    rewardSure(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          // alert("submit!");
          console.log("审核");
          // 审核（列表上方）
          if (this.typeFlag == 0) {
            // console.log(this.datas.radio);
            if (this.datas.radio == 1) {
              // this.datas.remark=""
              this.change(1, false);
              this.$refs.ruleForm.resetFields();
            } else {
              // this.datas.region=""
              this.change(2, false);
              this.$refs.ruleForm.resetFields();
            }
            // 修改（每一行）
          } else {
            this.change(0, true);
          }
        } else {
          this.$message({
            showClose: true,
            message: "有必填项没填写!",
            type: "warning"
          });
          return false;
        }
      });
      this.dialogVisible = false;
    },

    // 批量审核通过/单行审核通过、复用请求
    AuditPass(e) {
      this.isDisable = true;
      const datas = e;
      AuditPass(datas)
        .then(res => {
          this.isDisable = false;
          // console.log(res);
          if (!res.data.code) {
            this.getList(this.params);
          } else {
            this.$message.error(res.data.msg);
          }
        })
        .catch(error => {
          this.$message.error(error);
          this.tableLoading = false;
        });
    },
    // 审核驳回、待审核复用请求
    Reject(e) {
      const datas = e;
      Reject(datas)
        .then(res => {
          // console.log(res)
          if (!res.data.code) {
            this.getList(this.params);
          } else {
            this.$message.error(res.data.msg);
          }
        })
        .catch(error => {
          this.$message.error(error);
          this.tableLoading = false;
        });
    },
    // 改变页面条数
    handleSizeChange(val) {
      // this.params.pageNum = 1;
      this.params.pageSize = val;
      this.getList(this.params);
    },
    // 选择页数
    handleCurrentChange(val) {
      this.params.pageNum = val;
      this.getList(this.params);
    }
  }
};
</script>
<style scoped>
/* 分页 */
.pagesCon {
  height: 40px;
  margin-top: 20px;
}
.pagesCon > div {
  float: right;
}
/* 表单样式修改 */
.el-range-editor--medium.el-input__inner {
  width: 236px;
}
.el-table .cell,
.el-table th div {
  padding-right: 10px;
  overflow: hidden;
  text-overflow: clip;
}
h4 {
  color: #606266;
  font-size: 16px;
}
</style>
